home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 5.00 Begin VB.Form Form1 Appearance = 0 'Flat BackColor = &H00C0C0C0& Caption = "Socket/X COM w/ Fast Notifications" ClientHeight = 2400 ClientLeft = 1935 ClientTop = 2745 ClientWidth = 5130 BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& LinkTopic = "Form1" PaletteMode = 1 'UseZOrder ScaleHeight = 2400 ScaleWidth = 5130 Begin VB.TextBox Text3 Appearance = 0 'Flat BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 285 Left = 1800 TabIndex = 2 Text = "5" Top = 1320 Width = 855 End Begin VB.TextBox Text2 Appearance = 0 'Flat BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 285 Left = 1800 TabIndex = 4 Text = "80" Top = 960 Width = 855 End Begin VB.TextBox Text1 Appearance = 0 'Flat BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 285 Left = 1800 TabIndex = 3 Text = "198.211.8.88" Top = 600 Width = 3015 End Begin VB.CommandButton Command1 Appearance = 0 'Flat BackColor = &H80000005& Caption = "Test Connection" Default = -1 'True BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 375 Left = 1800 TabIndex = 0 Top = 1920 Width = 1695 End Begin VB.Label Label5 Alignment = 1 'Right Justify Appearance = 0 'Flat BackColor = &H00C0C0C0& Caption = "(in secs)" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 255 Left = 840 TabIndex = 8 Top = 1560 Width = 855 End Begin VB.Label Label4 Alignment = 1 'Right Justify Appearance = 0 'Flat BackColor = &H00C0C0C0& Caption = "Interval:" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 255 Left = 480 TabIndex = 5 Top = 1320 Width = 1215 End Begin VB.Label Label3 Alignment = 1 'Right Justify Appearance = 0 'Flat BackColor = &H00C0C0C0& Caption = "Remote Port:" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 255 Left = 360 TabIndex = 7 Top = 960 Width = 1335 End Begin VB.Label Label2 Alignment = 1 'Right Justify Appearance = 0 'Flat BackColor = &H00C0C0C0& Caption = "Remote IP:" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 255 Left = 600 TabIndex = 6 Top = 600 Width = 1095 End Begin VB.Label Label1 Appearance = 0 'Flat BackColor = &H00C0C0C0& Caption = "Result:" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 255 Left = 1080 TabIndex = 1 Top = 120 Width = 3975 End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Dim WithEvents SocketXObj1 As SocketXObj Attribute SocketXObj1.VB_VarHelpID = -1 Implements ISocketXObjNotify Private Sub Command1_Click() MousePointer = 11 Command1.Enabled = False Label1.Caption = "Result: " 'create the socket SocketXObj1.LocalAddress = "0.0.0.0" SocketXObj1.LocalPort = 0 SocketXObj1.Create 'configure the control with the socket 'of the remote server SocketXObj1.RemoteAddress = Text1.Text SocketXObj1.RemotePort = CInt(Text2.Text) SocketXObj1.Blocking = False ' 'attempt to connect SocketXObj1.ConnectTimeout = CInt(Text3.Text) SocketXObj1.Connect End Sub Private Sub Form_Load() Set SocketXObj1 = New SocketXObj SocketXObj1.NotificationObject = Me End Sub Private Sub Form_Unload(Cancel As Integer) Set SocketXObj1 = Nothing End Sub Private Sub ISocketXObjNotify_Accept(ByVal SocketXObject As SocketXObjLib.ISocketXObj, ByVal SocketHandle As Long, ByVal ErrorCode As Integer) End Sub Private Sub ISocketXObjNotify_Close(ByVal SocketXObject As SocketXObjLib.ISocketXObj, ByVal ErrorCode As Integer) End Sub Private Sub ISocketXObjNotify_Connect(ByVal SocketXObject As SocketXObjLib.ISocketXObj, ByVal ErrorCode As Integer) End Sub Private Sub ISocketXObjNotify_Done(ByVal SocketXObject As SocketXObjLib.ISocketXObj, ByVal LastMethod As SocketXObjLib.MethodsEnum, ByVal ErrorCode As Integer) If LastMethod = soxConnect Then If ErrorCode = 0 Then Label1.Caption = Label1.Caption & "Connection is up." Else Label1.Caption = Label1.Caption & "Connection is NOT up (" & CStr(ErrorCode) & ")." End If SocketXObj1.Close Command1.Enabled = True MousePointer = 0 End If End Sub Private Sub ISocketXObjNotify_OutOfBandData(ByVal SocketXObject As SocketXObjLib.ISocketXObj, ByVal ErrorCode As Integer) End Sub Private Sub ISocketXObjNotify_Receive(ByVal SocketXObject As SocketXObjLib.ISocketXObj, ByVal ErrorCode As Integer) End Sub Private Sub ISocketXObjNotify_Send(ByVal SocketXObject As SocketXObjLib.ISocketXObj, ByVal ErrorCode As Integer) End Sub